﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// ThucPham Repository. Good example of CRUD operations.
    ///// </summary>
    public class ThucPhamRepository : IThucPhamRepository
    {
        private static readonly IThucPhamDao _thucPham = DataAccess.ThucPhamDao;
        public List<ThucPham> GetList()
        {
            return _thucPham.GetThucPham().ToList();
        }

        public ThucPham Get(string id)
        {
            return _thucPham.GetThucPhamByID(id);
        }

        public void Insert(ThucPham t)
        {
            _thucPham.InsertThucPham(t);
        }

        public void Update(ThucPham t)
        {
            _thucPham.UpdateThucPham(t);
        }

        public void Delete(ThucPham t)
        {
            _thucPham.DeleteThucPham(t);
        }
    }
}